package ab.mes.mapper;

import ab.mes.entity.Material;
import ab.mes.tools.Result;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrdersBomMapper {
    //获取物料信息
    @Select("SELECT * FROM material ORDER BY id_Of_Material DESC")
    public List<Material> selectMaterial1();
    //根据编号获取物料信息
    @Select("SELECT id_Of_Material FROM material WHERE id_Of_Material=#{id_Of_Material} ORDER BY id_Of_Material DESC")
    public List<Material> selectByNumber(Integer id_Of_Material);
    //新增物料信息
    public Result insertMaterial(Material material);
    //删除物料信息
    @Delete("delete from material where id_Of_Material=#{id_Of_Material}")
    public Result deleteMaterial(Integer id_Of_Material);
    //修改物料信息
    public Result editMaterial(Material material);

}
